<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>
        <p:tab title="Tables">
            <table width="100%">
                <tr>
                    <td>
                        <table width="100%"> 
                            <tr>
                                <td align="left"> 
                                    <p:selectBooleanCheckbox value="#{tablesBackingBean.selectAll}" >
                                        <p:ajax  listener="#{tablesBackingBean.doSelectAll}" update="tables"/>  
                                    </p:selectBooleanCheckbox>
                                </td>
                                <td align="left">
                                    <h:outputText value="Filter"/>
                                </td>
                                <td>
                                    <table width="100%">
                                        <tr>
                                            <td align="right">
                                                <p:inputText/>
                                            </td>
                                            <td align="right">
                                                <p:commandButton value="Filter"/>
                                            </td>
                                        </tr>
                                    </table>
                                </td>                                
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p:dataGrid columns="1" var ="table"  value="#{tablesBackingBean.objectInfos}" style="width: 100%" id="tables" rows="10" paginator="true">
                            <p:column>
                                <f:facet name="header">
                                    
                                </f:facet>
                                <table>
                                    <tr>
                                        <td>
                                            <p:selectBooleanCheckbox value="#{table.used}"/>
                                        </td>
                                        <td>
                                            <p:commandLink value="#{table.name}" action="#{tablesBackingBean.objectSelected(table)}"  ajax="false" style="text-transform: uppercase;"/>
                                        </td>
                                    </tr>
                                </table>
                                </p:column>
                        </p:dataGrid>
                    </td>
                </tr>
            </table>
        </p:tab>
    </body>
</html>